<?
require_once('../mod_config.php');

$moduol_name      = 'Administration';
$mod_id           = 5;

$table            = 'administrator';
$adt_id           = 'adt_id';
$adt_username     = 'adt_username';

$user_id          = getValue("user_id","int","SESSION");
/*-------------------- Class Module -----------------------*/
class module{
   var $total = 0;
   /**
    * getList
    * 
    * @param int $limit So luong ban ghi tra ve
    * @param int $start Vi tri ban ghi bat dau lay
    * @return array  Mang cac tu khoa
   */
   static public function getList($start=0,$limit){
      $array = array();
      $limit = ($limit > 0) ? $limit : 20;
      $db_query = new db_query(' SELECT   
                                    mod_id,
                                    mod_name,
                                    mod_fullname,
                                    mod_pathname,
                                    mod_order,
                                    mod_filename,
                                    mod_status
                                 FROM 
                                    moduols
                                 ORDER BY 
                                    mod_order DESC,
                                    mod_id DESC
                                 LIMIT '. $start . "," . $limit);
      $array = $db_query->resultArray();
      unset($db_query);
      return $array;
   }
   
   /**
    * getTotalVideo
    * @return int Tong so video co trong bang 
   */
   static public function getTotal(){
      $count = 0;
      $db_count = new db_query("SELECT count(mod_id) as count FROM moduols"); 
      $row = mysql_fetch_assoc($db_count->result);
      $count = (isset($row['count'])) ? $row['count'] : $count;
      return $count;
   }
 
}

$module = new module();
?>